class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        vector<int> ret;
        auto it1=nums.begin();
        auto it2=it1;
        int i=0;
        int j=0;
        while(it1+1!=nums.end()){
            it2=it1;
            j=i+1;
            while(it2+1!=nums.end()){
                if(*it1+*(it2+1)==target){
                    ret.push_back(i);
                    ret.push_back(j);
                    return ret;
                }
                j++;
                it2++;
            }
            i++;
            it1++;
        }
        return ret;
    }
};
